package timberman.core;
//package trunghv.game.nonstop;
//
//import com.badlogic.gdx.graphics.g2d.SpriteBatch;
//import com.badlogic.gdx.math.Vector2;
//import com.badlogic.gdx.scenes.scene2d.Actor;
//import com.badlogic.gdx.scenes.scene2d.Stage;
//
//public class DragDropStage extends Stage {
//	private Actor prev;
//	private Vector2 tmp = new Vector2();
//
//	public DragDropStage(float assumeWidth, float assumeHeight, boolean b,
//			SpriteBatch batch) {
//		super(assumeWidth, assumeHeight);
//	}
//
//	@Override
//	public boolean touchDown(int screenX, int screenY, int pointer, int button) {
//		tmp.set(screenX, screenY);
//		tmp.set(screenToStageCoordinates(tmp));
//		Actor hit = hit(tmp.x, tmp.y, true);
//		if (hit != null) {
//			// System.out.println("hit: "+hit+","+hit.getName());
//		}
//		if (hit != null && hit.getName() != null) {
//			// System.out.println("down: " + hit);
//			prev = hit;
//			// return true;
//		}
//		return super.touchDown(screenX, screenY, pointer, button);
//	}
//
//	@Override
//	public boolean touchDragged(int screenX, int screenY, int pointer) {
//		if (prev != null) {
//			tmp.set(screenX, screenY);
//			tmp.set(screenToStageCoordinates(tmp));
//			prev.setPosition(tmp.x - prev.getOriginX(),
//					tmp.y - prev.getOriginY());
//			// return true;
//		}
//		return super.touchDragged(screenX, screenY, pointer);
//	}
//
//	@Override
//	public boolean touchUp(int screenX, int screenY, int pointer, int button) {
//		if (prev != null) {
//			System.out.println("<dimen name=\"" + prev.getName()
//					+ "_x\" value=\"" + prev.getX() + "\" />");
//			System.out.println("<dimen name=\"" + prev.getName()
//					+ "_y\" value=\"" + prev.getY() + "\" />");
//			prev = null;
//			// return true;
//		}
//		return super.touchUp(screenX, screenY, pointer, button);
//	}
//}
